home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: 2005 Utilities
/
CHIP Utilities 2005.7z
/
CHIP Utilities 2005.iso
/
images
/
freedos.img
/
LEVEL1
/
LFN.CAB
/
bin
/
Lfn.bat
< prev
Wrap
DOS Batch File
|
2005-01-16
|
6KB
|
199 lines
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
:: Lfn Begin ::
if not exist %ramdrv%\bin\lmod.com %0 : _error missing lmod.com (check utils.%arcext%)
if not exist %ramdrv%\bin\varset.com %0 : _error missing varset.com (check utilz.%arcext%)
if not exist %ramdrv%\bin\doslfn.com %0 : _error missing 'DOSLFN.COM'
:_start
echo. >%tmp%\_Lfn.tmp
if not exist %ramdrv%\etc\global.set goto _noglob
type %ramdrv%\etc\global.set >%tmp%\_Lfn.tmp
:_noglob
if not exist %ramdrv%\etc\Lfn.set goto _nospec
type %ramdrv%\etc\Lfn.set >%tmp%\_Lfn.tmp
:_nospec
xgrep -sy "^[:s]*@*[:s]*s?e?t?[:s]*Lfn_.+=" %tmp%\_Lfn.tmp >%tmp%\_Lfn.bak
if errorlevel 1 goto _noset
xgrep -sy "^[:s]*@*[:s]*set[:s]+" %tmp%\_Lfn.bak >%tmp%\_Lfn.bat
xgrep -syv "^[:s]*@*[:s]*set[:s]+" %tmp%\_Lfn.bak >%tmp%\_Lfn.tmp
if errorlevel 1 goto _runset
lmod /L* set []<%tmp%\_Lfn.tmp >>%tmp%\_Lfn.bat
:_runset
call %tmp%\_Lfn.bat
:_noset
if "%Lfn_ti%"=="" set Lfn_ti=5
if "%Lfn_write%"=="" set Lfn_write=1
if "%Lfn_tilde%"=="" set Lfn_tilde=1
if "%Lfn_tunnel%"=="" set Lfn_tunnel=1
if "%Lfn_cdrom%"=="" set Lfn_cdrom=1
if "%Lfn_indos%"=="" set Lfn_indos=1
if "%Lfn_cdro%"=="" set Lfn_cdro=1
for %%i in (-u -U) do if "%1"=="%%i" goto _unload
if "%1"=="/u" goto _unload
if "%1"=="/U" goto _unload
for %%i in (-c -C) do if "%1"=="%%i" goto _config
if "%1"=="/c" goto _config
if "%1"=="/C" goto _config
for %%i in (-h -H -?) do if "%1"=="%%i" goto _usage
if "%1"=="/h" goto _usage
if "%1"=="/H" goto _usage
if "%1"=="/?" goto _usage
if "%Lfn_ncfg%"=="1" goto _nocfg
set wcb1=%Lfn_install%
call w.bat box @%0:w_cfg #2,%Lfn_ti%
if errorlevel 3 goto _end
set Lfn_install=%wcb1%
if errorlevel 2 goto _config
:_nocfg
:_install
if "%Lfn_install%"=="1" goto _dosbios
echo LFN: Skipping LFN Support (DOSLFN not installed)
goto _end
:_dosbios
set _Lfn=p:%ramdrv%\bin
if "%Lfn_write%"=="1" set _Lfn=%_Lfn% w+
if not "%Lfn_write%"=="1" set _Lfn=%_Lfn% w-
if "%Lfn_tilde%"=="1" set _Lfn=%_Lfn% ~+
if not "%Lfn_tilde%"=="1" set _Lfn=%_Lfn% ~-
if "%Lfn_tunnel%"=="1" set _Lfn=%_Lfn% t+
if not "%Lfn_tunnel%"=="1" set _Lfn=%_Lfn% t-
if "%Lfn_cdrom%"=="1" set _Lfn=%_Lfn% c+
if not "%Lfn_cdrom%"=="1" set _Lfn=%_Lfn% c-
if "%Lfn_indos%"=="1" set _Lfn=%_Lfn% i+
if not "%Lfn_indos%"=="1" set _Lfn=%_Lfn% i-
if "%Lfn_cdro%"=="1" set _Lfn=%_Lfn% r+
if not "%Lfn_cdro%"=="1" set _Lfn=%_Lfn% r-
echo LFN: Installing DOSLFN %_Lfn%
if not "%lfn_low%"=="1" %ldh% %ramdrv%\bin\doslfn.com %_Lfn% %1 %2 %3 %4 %5 %6 %7 %8
if "%lfn_low%"=="1" %ramdrv%\bin\doslfn.com %_Lfn% %1 %2 %3 %4 %5 %6 %7 %8
goto _end
:_unload
echo LFN: Unloading DOSLFN
%ramdrv%\bin\doslfn.com u
goto _end
:_config
echo :w_config "DOSLFN configuration" [x]>%tmp%\_Lfn.tmp
echo.>>%tmp%\_Lfn.tmp
echo Dialog timeout [$ Lfn_ti,3] seconds.>>%tmp%\_Lfn.tmp
echo [!] Skip "Install DOSLFN or go config?" dialog>>%tmp%\_Lfn.tmp
echo.>>%tmp%\_Lfn.tmp
echo [.] Install LFN Support >>%tmp%\_Lfn.tmp
echo [!] Write Access >>%tmp%\_Lfn.tmp
echo [!] Tilde Usage (~~1) >>%tmp%\_Lfn.tmp
echo [!] Tunnel Effect (preserve LFN in Windows) >>%tmp%\_Lfn.tmp
echo [!] CDROM Support >>%tmp%\_Lfn.tmp
echo [!] InDOS Flag + Reset Drives >>%tmp%\_Lfn.tmp
echo [!] Read Only Bit for CDROM >>%tmp%\_Lfn.tmp
echo.>>%tmp%\_Lfn.tmp
echo [.] Do NOT install LFN support >>%tmp%\_Lfn.tmp
echo.>>%tmp%\_Lfn.tmp
echo [ Save ] [? Cancel ]>>%tmp%\_Lfn.tmp
set wcb1=%Lfn_ncfg%
set wcb2=%Lfn_write%
set wcb3=%Lfn_tilde%
set wcb4=%Lfn_tunnel%
set wcb5=%Lfn_cdrom%
set wcb6=%Lfn_indos%
set wcb7=%Lfn_cdro%
set wrb=2
if "%Lfn_install%"=="1" set wrb=1
call w.bat box @%tmp%\_Lfn.tmp:w_config
if errorlevel 2 goto _end
set Lfn_ncfg=%wcb1%
set Lfn_write=%wcb2%
set Lfn_tilde=%wcb3%
set Lfn_tunnel=%wcb4%
set Lfn_cdrom=%wcb5%
set Lfn_indos=%wcb6%
set Lfn_cdro=%wcb7%
set Lfn_install=%wrb%
if not "%wrb%"=="1" set Lfn_install=0
set t_out=1
call drd.bat %srcdrv%
if errorlevel 1 set t_out=0
wbat box @%0:w_wprot #1,%t_out%
set t_out=
if errorlevel 2 goto _start
echo LFN: Saving configuration...
set | tfind /f1,4 "Lfn_">%tmp%\_Lfn.bat
if not exist %srcdrv%\etc\*.* mkdir %srcdrv%\etc
if not exist %ramdrv%\etc\global.set goto _yglob
xgrep -syv "^[:s]*@*[:s]*s?e?t?[:s]*Lfn_.+=" %ramdrv%\etc\global.set >>%tmp%\_Lfn.bat
:_yglob
type %tmp%\_Lfn.bat >%srcdrv%\etc\global.set
type %tmp%\_Lfn.bat >%ramdrv%\etc\global.set
if exist %srcdrv%\etc\Lfn.set del %srcdrv%\etc\Lfn.set >%tmp%\nul
if exist %ramdrv%\etc\Lfn.set del %ramdrv%\etc\Lfn.set >%tmp%\nul
echo LFN: Configuration saved to %srcdrv%\etc\global.set
echo.
goto _start
:w_cfg "Install DOSLFN or go config?" [x]
(~press any key~: #? sec.)
[!] Installing LFN support ...
Fully supported on MsDOS 7.10
Partially supported on FreeDOS
(best with Volkov Commander)
[ Ok ] [ Config ] [? Abort ]
::
:w_wprot "Disable write protection..." [x]
If the disk in drive %srcdrv% is write
protected, please disable the write
protection now in order to save settings.
You can re-enable write protection after
saving.
[ Ok ] [? Cancel ]
::
:_usage
echo Parameters:
echo -c Config mode
echo -u Unload
echo -h This help info
echo.
goto _end
:_error
shift
shift
echo.
echo LFN: Error%errorlevel% %1 %2 %3 %4 %5 %6 %7 %8
echo.
@rem pause
goto _end
:_abort
echo LFN: Aborted...
echo.
@rem pause
:_end
set | tfind /f1,2 "W_" >%tmp%\_Lfn.tmp
set | tfind /f1,4 "Lfn_" >>%tmp%\_Lfn.tmp
type %tmp%\_Lfn.tmp | lmod /L* /B= set [$1]=>%tmp%\_Lfn.bat
call %tmp%\_Lfn.bat
if exist %tmp%\_Lfn.* del %tmp%\_Lfn.*
set _Lfn=
set ?=
set wcb1=
set wcb2=
set wcb3=
set wcb4=
set wcb5=
set wcb6=
set wcb7=
set wcb8=
set wcb9=
set wrb=
set wbat=
:: Lfn End ::